<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'签约'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "84">
<div class="analyItem">
   <p class="analyItemTit tx-center">照片</p>
        <div class="analyItemCon">

        <p class="col-md-4">
            <span  class="cLightGray col-md-12">艺术照片</span>
            <rx-viewer class="mr10 fl mt20" >
                <div    class="look_imgHover fl relative pb20 tx-center" style="width:78px;height:78px;" >
                    <img  :src="this.userInfoPhoto[36]" />
                    <div class="upload_finish_div">
                        <div class="upload_finish_bg"></div>
                        <div class="upload_finish_linksm">
                            <div class="dis-il-block">
                                <a href="javascript:" class="ImgBtn enlarge_viewer enlarge_link" ></a>
                            </div>
                        </div>
                    </div>
                    <!-- <input type="button" class="uiBtn-small uiBtn-red" value="删除"> -->
                </div>
            </rx-viewer>
        </p>
        <p class="col-md-4">
            <span class="cLightGray col-md-12">一寸照片</span>
            <rx-viewer class="mr10 fl mt20" >
                <div   class="look_imgHover fl relative tx-center pb20" style="width:78px;height:78px;" >
                <img  :src="this.userInfoPhoto[41]" />
                    <div class="upload_finish_div">
                        <div class="upload_finish_bg"></div>
                        <div class="upload_finish_linksm">
                            <div class="dis-il-block">
                                <a href="javascript:" class="ImgBtn enlarge_viewer enlarge_link"></a>
                            </div>
                        </div>
                    </div>
                    <!-- <input type="button" class="uiBtn-small uiBtn-red" value="删除"> -->
                </div>
            </rx-viewer>
        </p>
        </div>
    </div>
    <div class="analyItem">
      <p class="analyItemTit tx-center">银行</p>
        <div class="analyItemCon">
            <p class="col-md-4">
                <span class="cLightGray pr8">开户行</span>
                <span name="stage_info_bank_open">{{stageInfo.bank_open ? stageInfo.bank_open : ''}}</span>
            </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">姓名</span>
                <span name="stage_info_bank_name">{{stageInfo.bank_name ? stageInfo.bank_name : ''}}</span>
           </p>
            <p class="col-md-4">
                <span class="cLightGray pr8">帐号</span>
                <span name="stage_info_bank_account">{{stageInfo.bank_account ? stageInfo.bank_account : ''}}</span>
            </p>
            <p class="col-md-4">
                <rx-viewer :options="{}"  >
                        <div class="fl mb10 mr20">
                            <div class="look_imgHover relative" :style="elstyle" >
                            <img  :src="this.userInfoPhoto[4]"/>
                                <div class="upload_finish_div">
                                    <div class="upload_finish_bg"></div>
                                    <div class="upload_finish_link">
                                        <div class="dis-il-block">
                                            <a href="javascript:" class="ImgBtn enlarge_link enlarge_viewer"></a>
                                        </div>
                                    </div>
                                </div>
                                <div class="imgInfo tx-center">合同</div>
                            </div>
                        </div>
                </rx-viewer>
            </p>
      </div>
      </div>
      <div class="analyItem">
            <p class="analyItemTit tx-center">费用</p>
            <div class="analyItemCon" v-if="this.Manager.user_join_state == 1">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">押金</span>
                        <span>30000</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">实缴</span>
                        <span>{{platformMoney ? platformMoney : 0}}</span>
                    </p>
            </div>

            <div class="analyItemCon" v-if="this.Manager.user_join_state == 2">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">押金和平台费</span>
                        <span>10000+5000</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">实缴</span>
                        <span>{{platformMoney ? platformMoney : 0}}</span>
                    </p>
            </div>
            <div class="analyItemCon" v-else>
                        <p class="col-md-6">
                            <span class="cLightGray pr8">押金</span>
                            <span>0</span>
                        </p>
                        <p class="col-md-6">
                            <span class="cLightGray pr8">实缴</span>
                            <span>0</span>
                        </p>
                    </div>
        </div>
</div>

            <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">
            </div>
        </div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getUserListinfoPhoto, getPlatformMoney, selectPmUserInfoManager } from '../../Resources/Api'
export default {
    data () {
        return {
            platformMoney: 0,
            Manager: {}, // 入职类型
            userInfoPhoto: {},
            stageInfo: {},
            elstyle: {
                width: '100px',
                height: '100px',
                float: 'left'
            }
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    created () {
        this.stageInfo = this.$route.query.stageInfo
        this.getPlatformMoney() // 查询押金
        this.UerInfoPhoto()
        this.selectPmUserInfoManager()
    },
    methods: {
        // 获取照片信息
        UerInfoPhoto () {
            let _this = this
            _this.userInfoPhoto = {}
            getUserListinfoPhoto({
                uid: this.leftInfo.uid // this.leftInfo.uid
            }).then(result => {
                if (result.data.StatusCode === 0) {
                    this.userInfoPhoto = result.data.Body
                }
            }).catch(err => {
                console.log(err)
            })
        },
        // 查询签约
        selectPmUserInfoManager () {
            selectPmUserInfoManager({
                uid: this.leftInfo.uid
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.Manager = res.data.Body
                    // this.userJoinState = this.Manager.user_join_state
                }
            }).catch(err => {
                console.log('查询签约 selectPmUserInfoManager失败，原因为' + err)
            })
        },
        // 获取押金明细表的内容
        getPlatformMoney () {
            this.selectPmUserInfoManager()
            getPlatformMoney({
                uid: this.leftInfo.uid
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.pmDeposit = res.data.Body.moneyMaps
                    this.pmDeposit.forEach(item => {
                        if (item.depositState === 1) {
                            // alert(item.pmDeposit)
                            this.platformMoney += item.pmDeposit
                        }
                    })

                    console.log(this.pmDeposit)
                }
            }).catch(err => {
                console.log('查询平台服务费 getPlatformMoney失败，原因为' + err)
            })
        }
    },
    route () {
    }
}
</script>

